#Set the "working directory," or basically the path to all your files
modelSetWD("C:\users\OldLiz\Desktop")

#Check the model
modelCheck("Bayesian_GLM-Model_2.rtf")

#Load data
modelData("stress_data_bugs_format.txt")

#Compile the model with 3 parallel MCMC chains
modelCompile(3)

#Generate random initialization values
modelGenInits()

#Burn-in 1000 chains
modelUpdate(1000)

#Identify the parameters you want to record
samplesSet("intercept")
samplesSet("intercept.prior")
samplesSet("income.slope")
samplesSet("income.slope.prior")
dicSet()

#Update your model with the remaining 9000 samples
modelUpdate(9000)

#Save the MCMC chains
samplesCoda(intercept, income_intercept_)
samplesCoda(intercept.prior, income_intercept_prior_)
samplesCoda(income.slope, income_slope_)
samplesCoda(income.slope.prior, income_slope_prior_)

#Evaluate the output
samplesStats("*")
samplesDensity("*")
dicStats()